﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8">
 <title>绑定列表</title>
    <link href="../Comm/Style/Table0.css" rel="stylesheet" type="text/css" />
    <link href="../Scripts/easyUI15/themes/icon.css" rel="stylesheet" type="text/css" />
    <link href="../Scripts/easyUI15/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <script src="../Scripts/easyUI15/jquery.min.js" type="text/javascript"></script>
    <script src="../Scripts/easyUI15/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="../Scripts/QueryString.js" type="text/javascript"></script>
    <script src="../Scripts/config.js" type="text/javascript"></script>
    <script language="JavaScript" src="../Comm/JScript.js" type="text/javascript"></script>
    <script src="../Scripts/CommonUnite.js" type="text/javascript"></script>
    <script src="../Scripts/EasyUIUtility.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        /* ESC Key Down */
        function Esc() {
            if (event.keyCode == 27)
                window.close();
            return true;
        }

        var fk_flow = GetQueryString('FK_Flow');
        var fk_node = GetQueryString('FK_Node');


        //页面启动函数.
        $(function () {

            $("#Msg").html("<img src=../Img/loading.gif />&nbsp;正在加载,请稍后......");

            InitPage();

            $("#Msg").html("");
        });

        //初始化数据.
        function InitPage() {

            var fk_flow = GetQueryString("FK_Flow");
            if (fk_flow == "")
                fk_flow = "001";

            //初始化表格.
            $.ajax({
                type: 'post',
                async: true,
                url: Handler + "?DoType=MyDeptFlow_Init&FK_Flow=" + fk_flow + "&m=" + Math.random(),
                dataType: 'html',
                success: function (data) {

                    alert(data);


                    if (data.indexOf('err@') == 0) {
                        alert(data);
                        return;
                    }

                    data = JSON.parse(data);

                    var attrs = data["Sys_MapAttr"];
                    var dt = data["dt"];

                    //输出列..
                    var newRow = "";
                    newRow = "<tr ><th class=Idx>序</th>";
                    for (var i = 0; i < attrs.length; i++) {
                        var attr = attrs[i];
                        newRow += "<th>" + attr.Name + "</th>";
                    }
                    newRow += "</tr>";
                    $("#Table1 tr:last").after(newRow);


                    //输出数据.
                    newRow = "";
                    for (var i = 0; i < dt.length; i++) {
                        var row = dt[i];
                        newRow = "<tr ><td class=Idx>" + i + "</td>";
                        for (var num = 0; num < attrs.length; num++) {
                            var attr = attrs[num];
                            newRow += "<td>" + row[attr.KeyOfEn] + "</td>";
                        }
                        newRow += "</tr>";
                        $("#Table1 tr:last").after(newRow);
                    }
                }

            });
        }

        function Search() {

            alert('第2期开发');
            return;
        }
        function ExpToExcel() {
            alert('第2期开发');
            return;
        }
    </script>
</head>
<body onkeypress="Esc()" class="easyui-layout">
    <div data-options="region:'center'" title="流程查询">

    <div id="Toolbar"> 关键字: <input type=text id="Keys" /> <input type="button"  id="Btn_Search"  onclick="Search()" value="查询" /> <input type="button"  id="Btn_ExpToExcel"  onclick="ExpToExcel()" value="导出Excel" />  </div>

        <table id="Table1" class="Table" cellpadding="0" cellspacing="0" border="0" style="width: 100%">
        <tr>
        <td></td>
        </tr>
        </table>
    </div>
    <div id="Msg">
    </div>
</body>
</html>
